//
//  ViewController.m
//  自己练习
//
//  Created by Mac on 15-11-24.
//  Copyright (c) 2015年 yqf. All rights reserved.
//

#import "ViewController.h"
#import "TestViewController.h"
@interface ViewController ()
{
    UILabel * l;
}
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    //标题
    self.title=@"尹桥锋";
    self.view.backgroundColor=[UIColor whiteColor];
    
    l=[UILabel new];
   l.text=@"我是神！";
    [l sizeToFit];
    l.center =CGPointMake(self.view.frame.size.width/2.0, self.view.frame.size.height/2.0);
    l.backgroundColor=[UIColor yellowColor];
    l.textColor=[UIColor greenColor];
    [self.view addSubview:l];
    
    UIButton * yin=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    yin.frame=CGRectMake(0, 20,60,30);
    
   [yin setTitle:@"我爱你" forState:UIControlStateNormal];
    [yin setBackgroundColor:[UIColor greenColor]];
    [yin setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [yin addTarget:self action:@selector(onClick) forControlEvents:UIControlEventTouchUpOutside];
    
    [self.view addSubview:yin];
    
	// Do any additional setup after loading the view, typically from a nib.
}

-(void)onClick:(id)sender{
    TestViewController * con=[TestViewController new];
    [self.navigationController pushViewController:con animated:YES];

}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
